<?php

    class canje 
    {
        public $sql;
        public $idcanje;
        public $fecha;
        public $idpersona;
        
        function canje ($idcanje) 
        {
            $this->sql = new DmpSql();
            $consulta = "SELECT 
                          canje.idcanje,
                          canje.fecha,
                          canje.idpersona
                        FROM
                          canje
                        WHERE
                          canje.idcanje =".$idcanje;
            $resultado = $this->sql->consultar($consulta, "sigh");
            $fila = mysql_fetch_array($resultado);
            $this->idcanje = $fila["idcanje"];
            $this->fecha = $fila["fecha"];
            $this->idpersona = $fila["idpersona"];
        }
    }

?>